var t = require("../../utils/request");

Component({
    properties: {
        marginTop: {
            type: String,
            value: "0px"
        }
    },
    data: {
        tableList: []
    },
    lifetimes: {
        attached: function() {
            this.getlist();
        }
    },
    methods: {
      // 文档中心明细
        goToDetail: function(event) {
            const zid = event.currentTarget.dataset.id;
            
            wx.redirectTo({
                url: `/pages/articledetail/articledetail?id=`+zid
            })
        },
        getlist: function() {
            var i = this;
            t.post1('/wechat/home/comtextinfo', {openid:2222}).then(function(t) {
                var r = [];
                "1" == t.code && (t.data.paramhelp.forEach(function(t,index) {
                    
                    r.push({ 
                        src: t.imageUrl,
                        text: t.name,
                        type: t.code,
                        id:(index+1),
                        sort: t.sort
                    });
                }), i.setData({
                    tableList: r
                }));
            });
        }
    }

});